Calculation of optimal PEEP